import { getUsersData, addUserData, editUserData, delUserData } from '../../api/users'

let state = {
    data: []
}

let mutations = {
    GET_DATA(state, v) {
        state.data = v
    },
}

let actions = {
    async getData({ commit }, row) {
        let r = await getUsersData(row)
        commit('GET_DATA', r.data)
    },
    async addData({ }, row) {
        let r = await addUserData(row)
        console.log(r)
    },
    async editData({ }, row) {
        console.log(row)
        let r = await editUserData(row)
        console.log(r)
    },
    async delData({ }, row) {
        let r = await delUserData(row)
        console.log(r)
    }
}

let getters = {

}





export default {
    namespaced: true,
    state,
    mutations,
    actions,
    getters
}